<template>
	<view>
		<cu-custom bgColor="bg-maincolor" :isBack="true">
			<block slot="content">
				学生列表
			</block>
		</cu-custom>
		<block>
			<view class="listbox bg-white" v-if="list!=''">
				<view class="list_box flex" v-for="(item,index) in list" :key="index" @tap="to_student(item.student_id)">
					<image :src="item.avatar" class="img_box"></image>
					<view class="center_box">
						<view class="name_box">{{item.nickname}}</view>
						<view class="school_box">{{item.school_name}}</view>
					</view>
					<view class="iconfont icon-you1 right_box"></view>
				</view>
			</view>
			<view class="nodata" v-if="list==''">无数据</view>
		</block>
	</view>
</template>

<script>
	const {
		appLogin,
		httpGet,
		httpPost
	} = require("@/utils/common.js")
	export default {
		data() {
			return {
				page:1,
				page_size:20,
				job_id:0,
				list:[]
			}
		},
		onLoad(option) {
			appLogin((user_info) => {
				this.job_id = option.job_id
				console.log(user_info)
				this.getstudent_list()
			})
		},
		methods: {
			getstudent_list(){
				httpGet({
					url: '/api/company/stdent_list',
					data:{
						page:this.page,
						page_size:this.page_size,
						job_id:this.job_id
					},
				}).then(res => {
					console.log(res)
					this.list = res.result.list
				})
			},
			to_student(student_id){
				uni.navigateTo({
					url:'student_cooperatice?student_id='+student_id
				})
			}
		}
	}
</script>

<style>
	.listbox{
		margin-top: 30rpx;
	}
	
	.list_box{
		height: 175rpx;
		padding-left: 29rpx;
		padding-top: 40rpx;
		border-bottom: solid 1rpx rgb(231,231,231);
	}
	
	.img_box{
		width: 95rpx;
		height: 95rpx;
		border-radius: 180rpx;
	}
	
	.center_box{
		margin-left: 27rpx;
		margin-top: 5rpx;
	}
	
	.name_box{
		font-size: 31rpx;
		color: #333333;
		margin-bottom: 20rpx;
	}
	
	.school_box{
		font-size: 26rpx;
		color: #666666;
	}
	
	.right_box{
		position: absolute;
		right: 34rpx;
		font-size: 25rpx;
		color: #bcbcbc;
		margin-top: 34rpx;
	}
	.nodata{
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 200rpx;
		font-size: larger;
	}
</style>
